package com.yangdm.web;

import com.yangdm.service.Oracle2MySQLService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @program: oracle2mysql_tool
 * @description: Oracle迁移MySQL接口
 * @author: yangdm
 * @create: 2024-12-24 16:31
 **/
@Controller
@RequestMapping("/api/oracle2mysql")
public class Oracle2MySQLController {

    @Autowired
    @Qualifier(value = "oracle2MySQLService")
    private Oracle2MySQLService oracle2MySQLService;

    @GetMapping(value = "/generateTableStructure")
    @ResponseBody
    public String generateTableStructure() {
        this.oracle2MySQLService.generateTableStructureSQLScripts();
        return "Oracle建表语句已成功转换为MySQL，请到指定文件夹中查看！";
    }

    @GetMapping(value = "/generateTableForeignKey")
    @ResponseBody
    public String generateTableForeignKey() {
        this.oracle2MySQLService.generateTableForeignKeySQLScripts();
        return "Oracle外键语法已成功转为MySQL，请到指定文件夹中查看！";
    }
}
